﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Jxym.DBUtility;
using Jxym.wlkc2011.Module.CMS.MODEL;

namespace Jxym.wlkc2011.Module.CMS.SERVER
{
    public partial class ContentClassDel : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string returnVaoue = "参数错误";
            if (!IsPostBack)
            {
                if (Request.Params["ID"] != null)
                {
                    try
                    {
                        int idstr = Convert.ToInt32(Request.Params["ID"]);
                        MsSqlDal<Cms_ContentClass> iUtm = new MsSqlDal<Cms_ContentClass>();
                        MsSqlDal<Cms_Site_ContentClass> cscc = new MsSqlDal<Cms_Site_ContentClass>();
                        MsSqlDal<Cms_Content> cc = new MsSqlDal<Cms_Content>();
                        cc.Delete("ContentClassID=" + idstr, null);
                        cscc.Delete("ContentClassID=" + idstr, null);
                        int count = iUtm.Delete(idstr);
                        returnVaoue = "删除完成";
                    }
                    catch (Exception ex)
                    {
                        returnVaoue = ex.Message;
                    }
                }
            }
            Response.Write("{'success':true,'msg':'" + returnVaoue + "'}");
        }
    }
}